{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!---\n",
    "Copyright (c) 2020 The Orbit Authors. All rights reserved. \n",
    "Use of this source code is governed by a BSD-style license that can be \n",
    "found in the LICENSE file.\n",
    "-->\n",
    "\n",
    "# Example Jupyter notebook for analyzing Orbit capture data\n",
    "\n",
    "This is a brief example notebook that shows how Jupyter notebooks can be used to load Orbit capture data. This is only for testing setup. If you can run the cells in this notebook successfully, the setup should be complete."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "dying-first",
   "metadata": {},
   "outputs": [],
   "source": [
    "import collections\n",
    "import functools\n",
    "# Read the file and open the capture by creating an OrbitCapture instance.\n",
    "from orbitutils.orbit_capture import OrbitCapture\n",
    "\n",
    "file_content = open(\"./orbitutils/testdata/OrbitTest_capture.orbit\", \"rb\").read()\n",
    "capture = OrbitCapture(file_content)\n",
    "\n",
    "print(\"Capture successfully opened and read!\")\n",
    "\n",
    "start_event = capture.events[0]\n",
    "print(\"Capture start time: \" + str(start_event.capture_started.capture_start_timestamp_ns) + \"ns\")\n",
    "\n",
    "print(\"Capture events: \" + str(len(capture.events)))"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "7e1399e3f8c0abf7ee1a87c8418367545cb407dfff54ddf4a9f1c1c57b52988e"
  },
  "kernelspec": {
   "display_name": "Python 3.9.0 64-bit",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
